package com.kang.service.serviceImpl;

import com.kang.mapper.AddressMapper;
import com.kang.pojo.Address;
import com.kang.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author 吃三明治派对中的康康
 * @Date 2022/5/1 19:31
 * @Version 1.0
 */
@Service
public class AddressServiceImpl implements AddressService {

    @Autowired
    AddressMapper addressMapper;

    @Override
    public void insertAddress(Address address) {
        addressMapper.insert(address);
    }

    @Override
    public List<Address> researchAddressByUid(int uid) {
        return addressMapper.searchAddressByUid(uid);
    }

    @Override
    public void deleteAddress(long aid) {
        addressMapper.deleteByPrimaryKey(aid);
    }

    @Override
    public Address researchAddressByAid(long aid) {
        return addressMapper.selectByPrimaryKey(aid);
    }

    @Override
    public void updateAddress(Address address) {
        addressMapper.updateByPrimaryKeySelective(address);
    }
}
